<?php

namespace App\Models;

use Illuminate\Support\Facades\Cache;
use Illuminate\Database\Eloquent\Model;

class BlackIp extends Model
{
    protected $table = 'black_ips';

    public static function getBlackIpList()
    {
        Cache::remember('blackIps', now()->addMinutes(5), function () {
            return BlackIp::get()->pluck('ip');
        });
        return Cache::get('blackIps')->toArray();
    }

}
